﻿#region

using System.Collections.Specialized;
using System.Configuration;

#endregion

namespace Chowpoo.Util
{
    ///<summary>
    ///  对系统System.Configuration的包装
    ///</summary>
    public sealed class ConfigurationHelper
    {
        ///<summary>
        ///</summary>
        public static NameValueCollection AppSettings
        {
            get { return ConfigurationManager.AppSettings; }
        }

        ///<summary>
        ///</summary>
        public static ConnectionStringSettingsCollection ConnectionStrings
        {
            get { return ConfigurationManager.ConnectionStrings; }
        }

        public static string GetAppSetting(string key, string defValue = null)
        {
            return AppSettings[key] ?? defValue;
        }
    }
}